home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIZipReader.idl < prev    next >
Text File  |  2006-05-08  |  5KB  |  154 lines

  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2.  *
  3.  * ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is Mozilla Communicator client code, released
  17.  * March 31, 1998.
  18.  *
  19.  * The Initial Developer of the Original Code is
  20.  * Netscape Communications Corporation.
  21.  * Portions created by the Initial Developer are Copyright (C) 1998
  22.  * the Initial Developer. All Rights Reserved.
  23.  *
  24.  * Contributor(s):
  25.  *   Daniel Veditz <dveditz@netscape.com>
  26.  *   Don Bragg <dbragg@netscape.com>
  27.  *   Samir Gehani <sgehani@netscape.com>
  28.  *   Mitch Stoltz <mstoltz@netscape.com>
  29.  *
  30.  * Alternatively, the contents of this file may be used under the terms of
  31.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  32.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  33.  * in which case the provisions of the GPL or the LGPL are applicable instead
  34.  * of those above. If you wish to allow use of your version of this file only
  35.  * under the terms of either the GPL or the LGPL, and not to allow others to
  36.  * use your version of this file under the terms of the MPL, indicate your
  37.  * decision by deleting the provisions above and replace them with the notice
  38.  * and other provisions required by the GPL or the LGPL. If you do not delete
  39.  * the provisions above, a recipient may use your version of this file under
  40.  * the terms of any one of the MPL, the GPL or the LGPL.
  41.  *
  42.  * ***** END LICENSE BLOCK ***** */
  43.  
  44. #include "nsISupports.idl"
  45.  
  46. interface nsISimpleEnumerator;
  47. interface nsIInputStream;
  48. interface nsIFile;
  49.  
  50. [scriptable, uuid(6ca5e43e-9632-11d3-8cd9-0060b0fc14a3)]
  51. interface nsIZipEntry : nsISupports
  52. {
  53.     readonly attribute string           name;
  54.     readonly attribute unsigned short   compression;
  55.     readonly attribute unsigned long    size;
  56.     readonly attribute unsigned long    realSize;
  57.     readonly attribute unsigned long    CRC32;
  58. };
  59.  
  60. [scriptable, uuid(6ff6a966-9632-11d3-8cd9-0060b0fc14a3)]
  61. interface nsIZipReader : nsISupports
  62. {
  63.     /**
  64.      * Initializes a zip reader after construction.
  65.      */
  66.     void init(in nsIFile zipFile);
  67.  
  68.     readonly attribute nsIFile file;
  69.  
  70.     /**
  71.      * Opens a zip reader.
  72.      */
  73.     void open();
  74.  
  75.     /**
  76.      * Closes a zip reader. Subsequent attempts to extract files or read from
  77.      * its input stream will result in an error.
  78.      */
  79.     void close();
  80.  
  81.     /**
  82.      * Tests the integrity of the archive by performing a CRC check 
  83.      * on each item expanded into memory.  If an entry is specified
  84.      * the integrity of only that item is tested.  If NULL is passed 
  85.      * in the inetgrity of all items in the archive are tested.  
  86.      */
  87.     void test(in string aEntryName);
  88.  
  89.     /**
  90.      * Extracts a zip entry into a local file specified by outFile.
  91.      */
  92.     void extract(in string zipEntry, in nsIFile outFile);
  93.  
  94.     /**
  95.      * Returns a nsIZipEntry describing a specified zip entry.
  96.      */
  97.     nsIZipEntry getEntry(in string zipEntry);
  98.  
  99.     /**
  100.      * Returns a simple enumerator whose elements are of type nsIZipEntry.
  101.      */
  102.     nsISimpleEnumerator/*<nsIZipEntry>*/ findEntries(in string aPattern);
  103.  
  104.     /**
  105.      * Returns an input stream containing the contents of the specified zip entry.
  106.      */
  107.     nsIInputStream getInputStream(in string zipEntry);
  108. };
  109.  
  110. ////////////////////////////////////////////////////////////////////////////////
  111. // nsIZipReaderCache
  112.  
  113. [scriptable, uuid(52c45d86-0cc3-11d4-986e-00c04fa0cf4a)]
  114. interface nsIZipReaderCache : nsISupports
  115. {
  116.     /**
  117.      * Initializes a new zip reader cache. 
  118.      * @param cacheSize - the number of released entries to maintain before
  119.      *   beginning to throw some out (note that the number of outstanding
  120.      *   entries can be much greater than this number -- this is the count
  121.      *   for those otherwise unused entries)
  122.      */
  123.     void init(in unsigned long cacheSize);
  124.  
  125.     /**
  126.      * Returns a (possibly shared) nsIZipReader for an nsIFile.
  127.      */
  128.     nsIZipReader getZip(in nsIFile zipFile);
  129. };
  130.  
  131. ////////////////////////////////////////////////////////////////////////////////
  132.  
  133. %{C++
  134.  
  135. #define NS_ZIPREADER_CID                             \
  136. { /* 7526a738-9632-11d3-8cd9-0060b0fc14a3 */         \
  137.     0x7526a738,                                      \
  138.     0x9632,                                          \
  139.     0x11d3,                                          \
  140.     {0x8c, 0xd9, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
  141. }
  142.  
  143. #define NS_ZIPREADERCACHE_CID                        \
  144. { /* 1b117e16-0cad-11d4-986e-00c04fa0cf4a */         \
  145.     0x1b117e16,                                      \
  146.     0x0cad,                                          \
  147.     0x11d4,                                          \
  148.     {0x98, 0x6e, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a} \
  149. }
  150.  
  151. %}
  152.  
  153. ////////////////////////////////////////////////////////////////////////////////
  154.